<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
	<c:set var="root" value="${pageContext.request.contextPath}"/>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<title>Lowin</title>
	<link rel="stylesheet" href="${root}/static/css/auth.css">


</head>

<body>

	<div class="lowin">
		<div class="lowin-brand">
			<img src="${root}/static/images/kodinger.jpg" alt="logo">
		</div>
		<div class="lowin-wrapper">
			<div class="lowin-box lowin-login">
				<div class="lowin-box-inner">
					<form id="loginform" autocomplete="off" action="${root}/login" method="post">
						<p>登录</p>
						<div><span style="color: red">${msg}</span></div>
						<div><span style="color: red" id="nameMsg"></span></div>
						<div class="lowin-group">
							<label>用户名 <a href="#" class="login-back-link">登录?</a></label>
							<input type="text" autocomplete="username" name="username" class="lowin-input" id="username">
						</div>
						<div class="lowin-group password-group">
							<label>密码 <a href="#" class="forgot-link">忘记密码?</a></label>
							<input type="password" name="password" autocomplete="current-password" class="lowin-input" id="password">
						</div>
						<button type="button" class="lowin-btn" onclick="return userLogin()">
							登录
						</button>

						<div class="text-foot">
							没有账户? <a href="${root}/register.jsp" class="register-link">注册</a>
						</div>
					</form>
				</div>
			</div>

			<%--<div class="lowin-box lowin-register">--%>
				<%--<div class="lowin-box-inner">--%>
					<%--<form>--%>
						<%--<p>Let's create your account</p>--%>
						<%--<div class="lowin-group">--%>
							<%--<label>Name</label>--%>
							<%--<input type="text" name="name" autocomplete="name" class="lowin-input">--%>
						<%--</div>--%>
						<%--<div class="lowin-group">--%>
							<%--<label>Email</label>--%>
							<%--<input type="email" autocomplete="email" name="email" class="lowin-input">--%>
						<%--</div>--%>
						<%--<div class="lowin-group">--%>
							<%--<label>Password</label>--%>
							<%--<input type="password" name="password" autocomplete="current-password" class="lowin-input">--%>
						<%--</div>--%>
						<%--<button class="lowin-btn">--%>
							<%--Sign Up--%>
						<%--</button>--%>

						<%--<div class="text-foot">--%>
							<%--Already have an account? <a href="" class="login-link">Login</a>--%>
						<%--</div>--%>
					<%--</form>--%>
				<%--</div>--%>
			</div>
		</div>
	
		<footer class="lowin-footer">
			Design By @itskodinger. More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
		</footer>
	</div>

	<script src="${root}/static/js/auth.js"></script>
	<script src="${root}/static/jquery/jquery-2.2.4.min.js"></script>
	<script>
		Auth.init({
			login_url: '${root}/login',
			forgot_url: '#forgot'
		});

		function userLogin() {
			var username = $("#username").val().trim();
			var password = $("#password").val().trim();

			if(username!="" ){
				if (password!=""){
					$("#loginform").submit();
				}else{
					var nameMsg = $("#nameMsg").html("密码不为空！");
					return false;
				}
			}else {
				var nameMsg = $("#nameMsg").html("用户名不为空！");
				return false;
			}

		}
	</script>
</body>
</html>